package gk.example.activity;

import gk.example.App;
import gk.example.BaseActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

import com.example.gkdate.R;

import de.hdodenhof.circleimageview.CircleImageView;

/**
 * 
 * Description:设置界面
 * 
 * @author Wenk.Chan（最新修改者）
 * @version 1.0（最新版本号）
 */
public class SettingActivity extends BaseActivity implements OnClickListener {
	private TextView mTvTopTitle;
	private ImageButton mBtnBack;
	private Button mBtnPersonalInfo;
	private Button mBtnClearCache;
	private Button mBtnRemindSetting;
	private Button mBtnFeedBack;
	private Button mBtnAbout;
	private CircleImageView mCircleImageView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

	}

	@Override
	protected void initView() {
		setContentView(R.layout.activity_setting);
		mTvTopTitle = (TextView) findViewById(R.id.tv_top_title);
		mBtnBack = (ImageButton) findViewById(R.id.btn_back);
		mBtnAbout = (Button) findViewById(R.id.btn_setting_about);
		mBtnClearCache = (Button) findViewById(R.id.btn_setting_clear_cache);
		mBtnFeedBack = (Button) findViewById(R.id.btn_setting_feedback);
		mBtnPersonalInfo = (Button) findViewById(R.id.btn_setting_personal_info);
		mBtnRemindSetting = (Button) findViewById(R.id.btn_setting_remind_setting);
		mCircleImageView = (CircleImageView) findViewById(R.id.iv_setting_head);
	}

	@Override
	protected void initEvent() {
		mTvTopTitle.setText(R.string.setting);
		mBtnBack.setOnClickListener(this);
		mBtnAbout.setOnClickListener(this);
		mBtnClearCache.setOnClickListener(this);
		mBtnFeedBack.setOnClickListener(this);
		mBtnRemindSetting.setOnClickListener(this);
		mBtnPersonalInfo.setOnClickListener(this);
		if (App.BmobUser.getUserHead() != null) {
			App.BmobUser.getUserHead().loadImageThumbnail(this, mCircleImageView,70,70,70);
		} else {
			mCircleImageView.setImageResource(R.drawable.default_round_head);
		}
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.btn_back:
			finish();
			break;
		case R.id.btn_setting_about:
			startActivity(new Intent(SettingActivity.this, AboutActivity.class));
			break;
		case R.id.btn_setting_clear_cache:
			break;
		case R.id.btn_setting_feedback:
			startActivity(new Intent(SettingActivity.this,
					FeedBackActivity.class));
			break;
		case R.id.btn_setting_personal_info:
			startActivity(new Intent(SettingActivity.this,
					PersonalInfoActivity.class));
			break;
		case R.id.btn_setting_remind_setting:
			break;
		default:
			break;
		}
	}

}
